<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>交易记录</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/store/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="__INDEX__/store/css/style.css"/>
		<link rel="stylesheet" href="__INDEX__/store/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/store/css/wallet.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<script type="text/javascript" src="__INDEX__/dist/jquery.min.js" ></script>
		<script type="text/javascript" src="__INDEX__/js/menudown.js" ></script>
	</head>
<style>
	.my_style{
		text-align: center;
	}
</style>
	<body>
		<header class="mui-bar mui-bar-nav">
		    <a style="text-decoration: none;" class=" mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		    <h1 class="mui-title">交易记录</h1>
		</header>
		<div class="mui-content">
			<div class="liansd_recbox"  id="chain_ul">

			</div>			
		</div>
		<input type="hidden" id="chain_id" value="{$chain_id}" />
		<input type="hidden" id="page" value="1" />
	</body>
</html>
{include file="public/footer" /}
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script>
		$.ajax({
			type:"post",
			data:{
				page:$("#page").val(),
				chain_id:$("#chain_id").val()
			},
			url:"{:url('store/agent/chain_record')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					for(var i=0;i<list.length;i++){
						var log=list[i];
						var typename = '';
						if(log.pay_type==1){
							typename = '现金';
						}else if(log.pay_type==2){
							typename = '微信';
						}else{
							typename = '支付宝';
						}
						html+='<div class="liansd_recitem">'+
									"<a href='/store/agent/liansuod_jypage.html?order_sn="+log.order_sn+"'>"+
										'<div class="liansd_recpribox clearfix">'+
											'<div class="left">金额(元)</div>'+
											'<div class="right">'+log.balance+'</div>'+
										'</div>'+
										'<ul class="liansd_recinfo">'+
											'<li class="clearfix">'+
												'<div class="left">时间</div>'+
												'<div class="right">'+log.add_time+'</div>'+
											'</li>'+
											'<li class="clearfix">'+
												'<div class="left">付款方式</div>'+
												'<div class="right">'+typename+'</div>'+
											'</li>'+
										'</ul>'+
									'</a>'+
								'</div>';
					}
				}else{
					html="没有记录";
				}
				$(".liansd_recbox").html(html);
				
			}
		});	
	
	
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				page	 : parseFloat($("#page").val())+1,
				chain_id : $("#chain_id").val()
			},
			url:"{:url('store/agent/chain_record')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
					var log=list[i];
						var typename = '';
						if(log.pay_type==1){
							typename = '现金';
						}else if(log.pay_type==2){
							typename = '微信';
						}else{
							typename = '支付宝';
						}
						html+='<div class="liansd_recitem">'+
									"<a href='/store/agent/liansuod_jypage.html?order_sn="+log.order_sn+"'>"+
										'<div class="liansd_recpribox clearfix">'+
											'<div class="left">金额(元)</div>'+
											'<div class="right">'+log.balance+'</div>'+
										'</div>'+
										'<ul class="liansd_recinfo">'+
											'<li class="clearfix">'+
												'<div class="left">时间</div>'+
												'<div class="right">'+log.add_time+'</div>'+
											'</li>'+
											'<li class="clearfix">'+
												'<div class="left">付款方式</div>'+
												'<div class="right">'+typename+'</div>'+
											'</li>'+
										'</ul>'+
									'</a>'+
								'</div>';
					}
				}else{
					html="已经到最后";
				}
				$(".liansd_recbox").append(html);
				
			}
		});
		
		}				
	})
	
</script>	

